import request from "@/request/index.js"
// 获取类型列表
export function getCategoryList(params) {
    return request({
      url: '/officesupplies/officeSupplies/listCategory',
      method: 'get',
      params
    })
  }
  
  // 获取商品列表
  export function getGoodsList(params) {
    return request({
      url: '/officesupplies/officeSupplies/listByCategory',
      method: 'get',
      params
    })
  }
  
  // 提交采购申请
  export function submitPurchase(data) {
    return request({
      url: '/officesupplies/officeSuppliesPurchaseApply/insertPurchaseApply?openSessionId='+JSON.parse(localStorage.getItem('user'))?.openSessionId,
      method: 'post',
      data: {
        ...data,
      }
    })
  }

    // 重报
    export function purchaseReApply(data) {
      return request({
        url: '/officesupplies/officeSuppliesPurchaseApply/purchaseReApply',
        method: 'post',
        data: {
          ...data,
          openSessionId: JSON.parse(localStorage.getItem('user'))?.openSessionId
        }
      })
    }

  // 获取申请记录详情
export function getApplyRecordDetails(id) {
  return request({
    url: `/officesupplies/officeSuppliesPurchaseApply/getApplyRecordDetails/${id}`,
    method: 'get'
  })
}

